import React, { useState, useEffect } from "react"

export default function Test() {
  const [count, setCount] = useState(0)
  
  useEffect(() => {
    console.log("test组件挂载/更新了")
    return () => {
      console.log("test组件卸载了")
    }
  })

  function handle(){
    setCount(count+1)
  }
  return (
    <div>
      <div>{count}</div>
      <button onClick={handle}>+</button>
    </div>
  )
}
